package com.ycorn.init;

import com.ycorn.auth.config.ApplicationConfig;
import com.ycorn.auth.config.WebConfig;
import com.ycorn.auth.config.WebSecurityConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class SpringApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    @Override
    protected Class<?>[] getRootConfigClasses() {
        //指定rootContext的配置类 springApplication.xml
        return new Class<?>[]{ApplicationConfig.class, WebSecurityConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        //指定servletContext的配置类 springMvc.xml
        return new Class<?>[]{WebConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        // server.port
        return new String[]{"/"};
    }
}